home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / ed3.zip / ED.MAN < prev    next >
Text File  |  1988-08-17  |  5KB  |  99 lines

  1. ed - line-oriented text editor, similar to UN*X V7 ed
  2.  
  3. syntax:
  4.     ed [existing-file]
  5.  
  6.     existing-file  Only an existing file can be opened.  Otherwise
  7.         a nameless edit buffer is opened; a name can be used with
  8.         the `f' or `w' commands.
  9.  
  10. As a line editor, ed operates in one of two modes: COMMAND mode, in which
  11. a colon is displayed at the screen's bottom to prompt for a command; and
  12. INPUT mode, in which all keyboard input is added to the file (edit buffer).
  13. From COMMAND mode, INPUT mode is entered by either the `i' or `a' commands.
  14. From INPUT mode, the COMMAND mode is restored by entering a line consisting
  15. of a single period by itself.  If such a line is desired in the file, it
  16. can be created by entering (for instance) two periods, then using the `s'
  17. command to change these to only one period.
  18.  
  19. A command consists of an optional line-range specification, a single char-
  20. acter indicating the command, and for some commands an optional third
  21. argument.  The line-range specification is either a single line number or
  22. a first-line number and a last-line number separated by a comma.  The
  23. character `^' means the first line of the file; `$' means the last line
  24. of the file.
  25.  
  26. Commands:
  27.     <newline>
  28.     If a line is specified, make that the new current line.
  29.     Otherwise advance the current-line-pointer by one line.
  30.     =    Print the line number of the current line.
  31.     .    (by itself)  Print the current line.
  32.     -    (by itself)  Move the current-line-pointer back one, and print
  33.     the new current line.
  34.     +    (by itself)  Move the current-line-pointer forward one, and
  35.     print the new current line.
  36.     !    Execute a shell command and return.
  37.     a    Go into INPUT mode with a new line following the current line.
  38.     (INPUT mode is terminated by an input line containing only a
  39.     period in the first column.)
  40.     i    Go into INPUT mode with a new line preceding the current line.
  41.     (INPUT mode is terminated by an input line containing only a
  42.     period in the first column.)
  43.     c    Delete the specified lines (or the current line) and then
  44.     add new lines in their place.  This is equivalent to a `d'
  45.     command followed by an `i' command.
  46.     d    Delete the specified range of lines (or the current line).
  47.     Leave the current-line-pointer at the following line.
  48.     e    Clear the edit buffer and begin editing a new file.  This
  49.     command fails if the buffer contains changes (or new lines)
  50.     which have not been written out.  To discard these changes
  51.     and edit a new file, use `E' instead of `e'.
  52.     E    Clear the edit buffer and begin editing a new file, regardless
  53.     of any changes to the current edit buffer.
  54.     f    Print the filename, or set it to a new name if specified.
  55.     j    Join the addressed lines together (or the current line to the
  56.     previous line).
  57.     k    Mark the addressed line with the specified letter.  Example:
  58.     `17ka' puts mark "a" on line 17.
  59.     l    List the addressed lines, showing all non-printing characters
  60.     and indicating the end-of-line.
  61.     m    Move the specified range of lines to follow the line number
  62.     given.  Example:  `5,7m3' moves lines 5 through 7 "up", to
  63.     follow line 3.
  64.   p,P    Print the specified lines.
  65.     q    Quit the editor.  This fails if the edit buffer contains any
  66.     changes.  If so, use `Q' instead.
  67.     Q    Quit the editor absolutely.  Any changes are discarded.
  68.     r    Read in a file, adding it after the current line.
  69.     s    Substitute text on the current line.  Example:  `s/alpha/beta/'
  70.     finds the string "alpha" and replaces it with "beta".
  71.     t    Transfer (copy) the specified range of lines to follow the line
  72.     number given.  Example:  `5,7t7' puts a copy of lines 5 through
  73.     7 after line 7.
  74.   w,W    Write the edit buffer out.  If a filename is given, it is used
  75.     and becomes the current filename.  If a range of lines is
  76.     specified, only those lines are written.
  77.     x    Write the entire buffer out to its file, and terminate.    
  78.     z    Print 21 lines.  `-', `.', or `+' may be given, and mean
  79.     "start 21 lines previous, end at current line", 
  80.     "start 11 lines previous, end 10 lines hence", or
  81.     "start at current line, end 21 lines from here", respectively.
  82.  
  83. BUGS and COMMENTS
  84. I haven't figured out how to split a line; I can't get a newline character
  85. into the substitution string.
  86.  
  87. The code started out as many small files.  It is now one file, but the
  88. result isn't as clean as it could be.  I've cleaned it up some, but in
  89. converting it to TurboC compliancy I've probably lost generic C compliancy.
  90. Headers describing its distribution history are appended to the code.
  91.  
  92. AUTHORS
  93. Brian Beattie seems to be the original author.  Kees Bot is associated
  94. with it.  Allan Holub authored some bitmap code.  Andy Tanenbaum ported
  95. it to MINIX, and posted it to Usenet.  Bob Montante ported it to MSDOS
  96. and did some minor dressing-up.  Lewis Carroll wrote Alice's Adventures
  97. in Wonderland; James Joyce wrote Finnegans Wake; they are clearly the
  98. spiritual wellsprings.
  99.